﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Story.Framework;
using Storys.Library;
using System.Data.SQLite;
using Storys.Collect.Entity;

namespace Storys.Collect
{
    public class SitesManager:ManagerBase
    {
        public void UpdateSite(SiteDS.SitesTableDataTable tb)
        {
            using (SQLiteConnection con = db.con)
            {
                SQLiteDataAdapter adp = new SQLiteDataAdapter("select * from SRSites", con);
                SQLiteCommandBuilder cmdBuilder = new SQLiteCommandBuilder(adp);
                adp.Update(tb);
            }
            
        }

        public SiteDS.SitesTableDataTable LoadSites()
        {
            SiteDS.SitesTableDataTable tb = new SiteDS.SitesTableDataTable();
            using (SQLiteConnection con = db.con)
            {
                SQLiteDataAdapter adp = new SQLiteDataAdapter("select * from SRSites", con);
                adp.Fill(tb);
            }
            return tb;
        }
    }
}
